package com.tp.movie;

import android.app.Activity;
import android.os.Bundle;

import io.vov.vitamio.MediaPlayer;
import io.vov.vitamio.widget.MediaController;
import io.vov.vitamio.widget.VideoView;

public class MainActivity extends Activity {

    private VideoView vv_main;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        if (!io.vov.vitamio.LibsChecker.checkVitamioLibs(this))
            return;
        vv_main = (VideoView) findViewById(R.id.vv_main);
        vv_main.setVideoPath("http://122.72.121.72/data4/video06/2012/08/01/04822d91-7751-406e-b338-0f978f74920d.mp4");
        vv_main.setMediaController(new MediaController(this));
        vv_main.requestFocus();

        vv_main.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
            @Override
            public void onPrepared(MediaPlayer mediaPlayer) {
                mediaPlayer.setPlaybackSpeed(1.0f);
            }
        });
        vv_main.start();
    }
}
